<!DOCTYPE html>
<html>
    <head>
        <script src="js/vue.js"></script>
    </head>
    <body>
        <div id="app">
            <button @click="showInfo">请单击</button>
            <p>
                {{msg}}
            </p>
        </div>
        <script>
            var vm = new Vue({
                el:'#app',
                data:{
                    msg:''
                },
                methods:{
                    showInfo(){
                        console.log('调用成功！');
                        this.msg = '已触发了button单击事件!';
                    }
                }
            });
        </script>
    </body>
</html>